package com.example.hello.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.minio.MinioClient;
import lombok.Data;

@Data
@Configuration
@ConfigurationProperties(prefix = "object.storage")
public class ObjectStorageConfig {
    private String accessKey;
    private String secretKey;
    private String endpoint;
    private String bucketName;
    private String internalEndpoint;

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint("https://" + endpoint)
                .credentials(accessKey, secretKey)
                .build();
    }
} 